<?php
class File_cateModel extends MongoModel {
    var $table  = 'file_cate';
    var $name = '文件分类';
    
	public function get_cates($type, $site_id=null){
		if($site_id == null) $site_id = SITE_ID;
		$file_cates = self::get_by_key($site_id, $type);
		if(!empty($file_cates[$type])){
			foreach($file_cates[$type] as $key=>&$cate){
				$cate['_id'] = $key;
			}
			return $file_cates[$type];
		}
		return null;
	}
}

?>